#include "AppDelegate.h"

#include "cocos2d.h"
#include "WelcomeScene.h"
#include "LoadingScene.h"
#include "SoundSettings.h"
USING_NS_CC;

AppDelegate::AppDelegate()
{
}

AppDelegate::~AppDelegate()
{
}

bool AppDelegate::applicationDidFinishLaunching()
{
	ready();
    return true;
}

void AppDelegate::applicationDidEnterBackground()
{
	stopMusic();
	CCDirector::sharedDirector()->pause();
}

void AppDelegate::applicationWillEnterForeground()
{
    CCDirector::sharedDirector()->resume();
    playBackground();
}
void AppDelegate::loading()
{
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
    pDirector->setAnimationInterval(1.0 / 60);
    CCScene *pScene = Loading::scene();
    pDirector->runWithScene(pScene);
}
void AppDelegate::ready()
{
  CCDirector *pDirector = CCDirector::sharedDirector();
  pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
  pDirector->setAnimationInterval(1.0 / 60);
  CCScene *pScene = Welcome::scene();
  pDirector->runWithScene(pScene);
}
